print-editor: Fix saving
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 15:16:52 +0000 (11:16 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 15:19:43 +0000 (11:19 -0400)
g_file_replace_contents() does not accept -1 as
length, unlike similar apis.

demos/print-editor/print-editor.c

index 2ac806df2f89cf9a6f0cbace111ac4f00b62b819..27202dd2ee834ea573179627a1de24e60c4e8505 100644 (file)
@@ -159,7 +159,7 @@ save_file (GFile *save_filename)
 
   error = NULL;
   g_file_replace_contents (save_filename,
-                           text, -1,
+                           text, strlen (text),
                            NULL, FALSE,
                            G_FILE_CREATE_NONE,
                            NULL,